﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Imaginecup.sprite;
using imaginecup.util;
using Imaginecup.util.resourceMan;
using Imaginecup.util;

namespace Imaginecup.gameState.ending.scene
{
    public class EndingNormalScene:IScene
    {
        private ISprite m_Sprite;
        private EntityInfo m_Info;
        private ILoadContent m_LoadContent;

        private double m_DelayTime ;
        private double m_CurrentTime = 0;
        private bool m_bComplete = false;

        public EndingNormalScene(double DelayTime)
        {
            m_Info = new EntityInfo(0, 0, 800, 480);
            m_DelayTime = DelayTime;
        }

        public void SetLoadEndingScene(ILoadContent content)
        {
            m_LoadContent = content;
        }

        public void LoadEndingScene()
        {
            m_Sprite = m_LoadContent.LoadSprite();
        }

        public void UnloadEndingScene()
        {
            m_Sprite.Release();
            m_LoadContent.UnloadResource();
        }

        public void Update(Microsoft.Xna.Framework.GameTime gameTime)
        {
            m_CurrentTime += gameTime.ElapsedGameTime.TotalSeconds;
            if (m_CurrentTime > m_DelayTime)
                m_bComplete = true;
        }

        public void Draw(Microsoft.Xna.Framework.Graphics.SpriteBatch spriteBatch)
        {
            m_Sprite.Draw(spriteBatch, m_Info);
        }

        public bool IsComplete()
        {
            //IMouseInputHandler inputHandler = MouseInputHandler.GetInputHandler();
            //if ( inputHandler.IsOneClick())
            //     return true;
            //return false;
            return m_bComplete;
        }
    }
}
